const path = require('path');
function resolve(dir) {
  return path.join(__dirname, dir);
}
module.exports = {
    publicPath: process.env.NODE_ENV === 'production'
    ? '/new_work_summary/'
    : '/',
    //2.链式操作：允许对内部的webpack配置进行更细粒度的修改
    chainWebpack: (config) => {
      config.resolve.alias
        .set('@', resolve('src'))
        .set('@assets',resolve('src/assets'))
        .set('@img', resolve('src/assets/img'))
        .set('@css', resolve('src/assets/css'))
        .set('@utils', resolve('src/api/utils'))
        .set('@components', resolve('src/components'))
        .set("@views", resolve('src/views'))
    },
    css: {
      loaderOptions: {
        sass: {
          data: `
          @import "@css/variable.scss";
          @import "@css/themeVariable.scss";
          @import "@css/themeMixin.scss";
          @import "@css/commonBase.scss";
          `,
        }
      }
    }

}